package com.example.dc.Service.Impl;

import com.example.dc.Service.SicknessService;
import com.example.dc.domain.Sickness;
import com.example.dc.mapper.SicknessMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SicknessServiceImpl implements SicknessService {
    @Autowired
    private SicknessMapper sicknessMapper;
    @Override
    public List<Sickness> getSickness() {
        List<Sickness> sicknesses= sicknessMapper.getSickness();
        return sicknesses;
    }

    @Override
    public void addSick(Integer userId, List<Integer> sicknessList) {
        //insert疾病信息
        for (Integer sickId:sicknessList){
            sicknessMapper.addSickness(userId,sickId);
        }
    }
}
